package com.example.demo.dto;

import com.example.demo.entity.RoutingRule;

public class RoutingRuleDTO {
    private Integer id;
    private Integer roleConfigId;

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getRoleConfigId() {
        return roleConfigId;
    }

    public void setRoleConfigId(Integer roleConfigId) {
        this.roleConfigId = roleConfigId;
    }

    public Integer getDeptId() {
        return deptId;
    }

    public void setDeptId(Integer deptId) {
        this.deptId = deptId;
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    public String getFieldValues() {
        return fieldValues;
    }

    public void setFieldValues(String fieldValues) {
        this.fieldValues = fieldValues;
    }

    public String getAssignedUsers() {
        return assignedUsers;
    }

    public void setAssignedUsers(String assignedUsers) {
        this.assignedUsers = assignedUsers;
    }

    private String roleName;
    private Integer deptId;
    private String deptName;
    private String fieldValues;
    private String assignedUsers;

    // 从实体类转换为DTO
    public static RoutingRuleDTO fromEntity(RoutingRule entity) {
        RoutingRuleDTO dto = new RoutingRuleDTO();
        dto.setId(entity.getId());
        dto.setRoleConfigId(entity.getRoleConfigId());
        dto.setRoleName(entity.getRoleName());
        dto.setDeptId(entity.getDeptId());
        dto.setDeptName(entity.getDeptName());
        dto.setFieldValues(entity.getFieldValues());
        dto.setAssignedUsers(entity.getAssignedUsers());
        return dto;
    }
}